﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DllDeezerDev;

namespace DllDezzerDev
{
    public class Track
    {
        #region Champs
        private string _id = "inconnue";
        private string _title = "inconnue";
        private string _link = "inconnue";
        private int _duration = 0;
        private string _rank = "inconnue";
        private string _preview = "inconnue";
        internal Artist _theArtist = new Artist();
        private string _type = "inconnue";
        internal Album _theAlbum = new Album();
        #endregion

        #region Proprieté
        /// <summary>
        /// Id de la track
        /// </summary>
        public string id
        {
            get { return _id; }
            set { _id = value; }
        }
        /// <summary>
        /// Titre de la track
        /// </summary>
        public string title
        {
            get { return _title; }
            set { _title = value; }
        }
        /// <summary>
        /// Lien du titre sur deezer
        /// </summary>

        public string link
        {
            get { return _link; }
            set { _link = value; }
        }
        /// <summary>
        /// Durée du track 
        /// </summary>

        public int duration
        {
            get { return _duration; }
            set { _duration = value; }
        }
        /// <summary>
        /// Rang maximum sur deezer
        /// </summary>
        public string rank
        {
            get { return _rank; }
            set { _rank = value; }
        }
        /// <summary>
        /// lien mp3 de la track
        /// </summary>
        public string preview
        {
            get { return _preview; }
            set { _preview = value; }
        }
        /// <summary>
        /// Artist du track
        /// </summary>
        internal Artist theArtist
        {
            get { return _theArtist; }
            set { _theArtist = value; }
        }
        /// <summary>
        /// Type de la track
        /// </summary>
        public string type
        {
            get { return _type; }
            set { _type = value; }
        }
        /// <summary>
        /// Album du track
        /// </summary>
        internal Album theAlbum
        {
            get { return _theAlbum; }
            set { _theAlbum = value; }
        }
        #endregion

        #region Constructeurs
        /// <summary>
        /// Initialise une nouvelle instance par défaut de la classe unAlbum.
        /// Les propriétés de l'Album ne peuvent pas être modifiées par la suite.
        /// </summary>
        public Track() 
        {
        }
        /// <summary>
        /// Initialise une nouvelle instance de la classe Album.
        /// </summary>
        /// <param name="id">id du track</param>
        /// <param name="title">Titre du track</param>
        /// <param name="link">Lien du track</param>
        /// <param name="preview">Lien de la preview</param>
        public Track(string id, string title,string link,string preview)
        {
            this.id=id;
            this.title=title;
            this.link=link;
            this.preview=preview;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id">Id du track</param>
        /// <param name="title">Titre du track</param>
        /// <param name="link">Lien du track</param>
        /// <param name="preview">Preview du track</param>
        /// <param name="theAlbum">Objet de type album</param>
        /// <param name="theArtist">Objet de type artist</param>
        public Track(string id, string title, string link, string preview, Album theAlbum, Artist theArtist)
        {
            this.id = id;
            this.title = title;
            this.link = link;
            this.preview = preview;
            this.theAlbum = theAlbum;
            this.theArtist = theArtist;
        }
        #endregion
    }
}
